//
//  SelectMyTableViewCell.m
//  BigTyre
//
//  Created by 💋索少杰 on 2017/3/22.
//  Copyright © 2017年 Lemon. All rights reserved.
//

#import "SelectMyTableViewCell.h"
#import <SDWebImage/UIImageView+WebCache.h>
#import <SDAutoLayout.h>

@implementation SelectMyTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
      
        _img=[[UIImageView alloc] init];
        _img.layer.cornerRadius=5;
        _img.layer.masksToBounds=YES;
        [self.contentView addSubview:self.img];
        
        _name=[[UILabel alloc] init];
        _name.font=[UIFont systemFontOfSize:20];
        _name.textColor=[UIColor blackColor];
        [self.contentView addSubview:self.name];
        
        
        
        _img.sd_layout
        .leftSpaceToView(self.contentView,0)
        .topSpaceToView(self.contentView,0)
        .widthIs(50)
        .heightIs(50);
        
        
        _name.sd_layout
        .leftSpaceToView(self.img,5)
        .topSpaceToView(self.contentView,16)
        .widthIs(200)
        .autoHeightRatio(0);
        
        
    }
    
    return self;
}
-(void)setModel:(SelectTyreModel *)model{
    
    [_img sd_setImageWithURL:[NSURL URLWithString:model.img] placeholderImage:[UIImage imageNamed:@""]];
    _name.text=model.name;
    
}



@end
